Imports System.IO

Module PathInfo
    Sub ShowPath(ByVal P As String)
        Try
            Console.WriteLine("Duong dan: {0}", P)

            Console.WriteLine("Ten thu muc: {0}", Path.GetDirectoryName(P))

            Console.WriteLine("Duoi mo rong: {0}", Path.GetExtension(P))

            Console.WriteLine("Ten file day du: {0}", Path.GetFileName(P))

            Console.WriteLine("Ten: {0}", Path.GetFileNameWithoutExtension(P))

            Console.WriteLine("Duong dan day du: {0}", Path.GetFullPath(P))

            Console.WriteLine("Thu muc goc: {0}", Path.GetPathRoot(P))

        Catch E As Exception
            Console.WriteLine(E.Message)
        End Try
    End Sub

    Sub Main()
        ShowPath("C:\Windows\Win.ini")
        ShowPath("C:AUTOEXEC.BAT")
        ShowPath("C:\")
        ShowPath("\")
        Console.ReadLine() 
    End Sub
End Module
